//package com.itheima.config;
//
//import org.mybatis.spring.SqlSessionFactoryBean;
//import org.mybatis.spring.mapper.MapperScannerConfigurer;
//import org.springframework.context.annotation.Bean;
//
//import javax.sql.DataSource;
//
//public class MybatisConfig {
//    //定义bean，SqlSessionFactoryBean，用于产生SqlSessionFactory对象
//    @Bean
//    public SqlSessionFactoryBean sqlSessionFactory(DataSource dataSource){
//        SqlSessionFactoryBean ssfb = new SqlSessionFactoryBean();
//        ssfb.setTypeAliasesPackage("com.itheima.domain");
//        ssfb.setDataSource(dataSource);
//        return ssfb;
//    }
//    //定义bean，返回MapperScannerConfigurer对象
//    @Bean
//    public MapperScannerConfigurer mapperScannerConfigurer(){
//        MapperScannerConfigurer msc = new MapperScannerConfigurer();
//        msc.setBasePackage("com.itheima.dao");
//        return msc;
//    }
//}
//
//
//
